﻿<%@ Page Language="C#" MasterPageFile="~/Demo.master" Inherits="DemoPage" Title="Using Update Panel in Dialog" %>

<%@ Register Src="~/CodeFormatter.ascx" TagName="Code" TagPrefix="demo" %>

<script runat="server">
    public void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
    {
        txtSelected.Text = TreeView1.SelectedNode.Text;
    }
    
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="DemoHolder" runat="Server">
    <div class="dna-state-help ui-corner-all">
        In this sample i will show you how to use the UpdatePanel in Dialog an do some work
        well.</div>
    <br />
    <DotNetAge:Dialog ID="DemoDialog" runat="server" Draggable="true" Resizable="false"
        Title="UpdatePanel in Dialog Sample" AutoOpen="true" OnClientClose="$(this).dialog('open');">
        <Buttons>
            <DotNetAge:DialogButton Text="OK" OnClientClick="$(this).dialog('close')" />
        </Buttons>
        <BodyTemplate>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <div style="margin: 10px; overflow: auto; height: 200px;">
                        <asp:TreeView ID="TreeView1" runat="server" ExpandDepth="1" OnSelectedNodeChanged="TreeView1_SelectedNodeChanged"
                            DataSourceID="XmlDataSource1" Font-Size="8pt" ForeColor="#666666">
                            <DataBindings>
                                <asp:TreeNodeBinding DataMember="TreeNode" ImageUrlField="ImageUrl" TextField="Text" />
                            </DataBindings>
                        </asp:TreeView>
                    </div>
                    <div style="border-top: solid 1px #f3f3f3; padding: 5px;">
                        <span style="float: left; font-size: 8pt;">Selected Item:</span><asp:TextBox ID="txtSelected"
                            runat="server" Width="200px" Font-Size="8"></asp:TextBox></div>
                </ContentTemplate>
            </asp:UpdatePanel>
            <asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
                <ProgressTemplate>
                    <div class="dna-state-loading-s">
                        <div>
                        </div>
                    </div>
                </ProgressTemplate>
            </asp:UpdateProgress>
        </BodyTemplate>
    </DotNetAge:Dialog>
    <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/Dialog/treeData.xml"
        XPath="Nodes/TreeNode"></asp:XmlDataSource>
    <br />
    <br />
    <br />
    <demo:Code runat="server" ID="codeView" SourceFile="~/Dialog/Codes/NestedUpdatePanelSample.aspx" />
</asp:Content>
